# -*- coding: utf-8 -*-

def MovePivot(arr, low, high):
    Pivot = arr[high]
    imove = (low - 1)
    for i in range(low, high):
        if arr[i] <= Pivot:
            imove += 1
            arr[imove], arr[i] = arr[i], arr[imove]
    arr[imove+1],arr[high] = arr[high], arr[imove+1]
    return imove+1

def QuickSort(arr, low, high):
    if low < high:
        pivot = MovePivot(arr, low, high)
        QuickSort(arr, low, pivot-1)
        QuickSort(arr, pivot+1, high)
        
s1 = [10,3,28,4,12,20]
QuickSort(s1, 0, len(s1)-1)
print(s1)
